#ifndef __HEAD__
#define __HEAD__
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <strings.h>
#include <sys/socket.h>
#include <pthread.h>
#include <unistd.h>
#include <error.h>
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/epoll.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <shadow.h>
#include <crypt.h>
#include <stdbool.h>
#include <syslog.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include <fcntl.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/md5.h>
#define LOG_CHECK(opt, arg)                                                                                           \
{                                                                                                                     \
    time_t tmp = time(NULL);                                                                                            \
    char buf[1024] = {0};                                                                                           \
    if (strcmp(opt, "login") == 0) {                                                                                  \
        syslog(LOG_DEBUG, "user: %s login core_file:%s : %d ,time : %s", arg, __FILE__, __LINE__, ctime_r(&tmp, buf));  \
    } else {                                                                                                          \
        syslog(LOG_DEBUG, "cmd: %s dir : %s  core_file:%s : %d , time : %s", opt, arg, __FILE__, __LINE__, ctime_r(&tmp, buf)); \
    }                                                                                                                 \
}
typedef struct train_s{
    int length;
    char data[4096];
}train_t;
int loginFunc(int sockfd);
int cdFunc(int sockfd);
int mkdirFunc(int sockfd);
int rmdirFunc(int sockfd);
int pwdFunc(int sockfd);
int recvn(int sockfd,void *buf, int length);
int lsFunc(int sockfd);
int removeFunc(int sockfd);
int getFileMD5(const char *filename, char *MD5);
int putsFunc(int sockfd, const char *filename);
int getsFunc(int sockfd, const char* filename);
#endif
